package com.system.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateTimeDeserializer;
import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateTimeSerializer;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * 维修
 *
 * @TableName maintain
 */
@TableName(value = "maintain")
@EqualsAndHashCode
@Data
@Accessors(chain = true)
public class Maintain implements Serializable {
    /**
     * id
     */
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    /**
     * 宿舍id
     */
    @TableField(value = "dorm_id")
    private Long dormId;

    /**
     * 维修内容
     */
    @TableField(value = "context")
    private String context;

    /**
     * 图片列表
     */
    @TableField(value = "picture")
    private String picture;

    /**
     * 申请者id
     */
    @TableField(value = "add_user_id")
    private Long addUserId;

    /**
     * 申请时间
     */
    @TableField(value = "add_time")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @JsonDeserialize(using = LocalDateTimeDeserializer.class)
    @JsonSerialize(using = LocalDateTimeSerializer.class)
    private LocalDateTime addTime;

    /**
     * 修理反馈
     */
    @TableField(value = "feedback")
    private String feedback;

    /**
     * 修理者id
     */
    @TableField(value = "handle_work_id")
    private long handleWorkId;

    /**
     * 修理时间
     */
    @TableField(value = "handle_time")
    private LocalDateTime handleTime;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;
}